//
//  CityTableViewCell.m
//  Qyer
//
//  Created by 赵宇 on 15/9/14.
//  Copyright (c) 2015年 赵宇. All rights reserved.
//

#import "CityTableViewCell.h"
#import "BaseHeader.h"
@implementation CityTableViewCell
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        UICollectionViewFlowLayout *flow = [[UICollectionViewFlowLayout alloc]init];
        flow.itemSize = CGSizeMake(SCREEN_WIDTH/7*3.1, SCREEN_WIDTH/7*4.4);
         flow.sectionInset = UIEdgeInsetsMake(SCREEN_WIDTH/35, SCREEN_WIDTH/25, SCREEN_WIDTH/35, SCREEN_WIDTH/25);
        [flow setMinimumInteritemSpacing:10];
        [flow setMinimumLineSpacing:10];
        

        _collection = [[UICollectionView alloc]initWithFrame:CGRectZero collectionViewLayout:flow];
        _collection.backgroundColor = [UIColor whiteColor];
        [self.contentView addSubview:self.collection];
        
        [_collection registerClass:[CityCollectionViewCell class] forCellWithReuseIdentifier:@"hotcity"];
        
    }
    return self;
}
-(void)setDataSource:(id<UICollectionViewDataSource>)dataSource
{
    [self.collection setDataSource:dataSource];
}
-(void)setDelegate:(id<UICollectionViewDelegate>)delegate
{
    [self.collection setDelegate:delegate];
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
